package cn.edu.bjtu.toychange.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;


/**
 * The persistent class for the transrecord database table.
 * 
 */
@Entity
//@NamedQuery(name="Transrecord.findAll", query="SELECT t FROM Transrecord t")
public class TransRecord implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int t_transRecordID;

	private int t_transState;

	@Temporal(TemporalType.DATE)
	private Date t_transTime;

	private int t_userAComment;

	private int t_userBComment;

	//bi-directional many-to-one association to Toy
	@ManyToOne
	@JoinColumn(name="T_toyBID")
	private Toy toy1;

	//bi-directional many-to-one association to Toy
	@ManyToOne
	@JoinColumn(name="T_toyAID")
	private Toy toy2;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="T_userAID")
	private User user1;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="T_userBID")
	private User user2;

	public TransRecord() {
	}

	public int getT_transRecordID() {
		return this.t_transRecordID;
	}

	public void setT_transRecordID(int t_transRecordID) {
		this.t_transRecordID = t_transRecordID;
	}

	public int getT_transState() {
		return this.t_transState;
	}

	public void setT_transState(int t_transState) {
		this.t_transState = t_transState;
	}

	public Date getT_transTime() {
		return this.t_transTime;
	}

	public void setT_transTime(Date t_transTime) {
		this.t_transTime = t_transTime;
	}

	public int getT_userAComment() {
		return this.t_userAComment;
	}

	public void setT_userAComment(int t_userAComment) {
		this.t_userAComment = t_userAComment;
	}

	public int getT_userBComment() {
		return this.t_userBComment;
	}

	public void setT_userBComment(int t_userBComment) {
		this.t_userBComment = t_userBComment;
	}

	public Toy getToy1() {
		return this.toy1;
	}

	public void setToy1(Toy toy1) {
		this.toy1 = toy1;
	}

	public Toy getToy2() {
		return this.toy2;
	}

	public void setToy2(Toy toy2) {
		this.toy2 = toy2;
	}

	public User getUser1() {
		return this.user1;
	}

	public void setUser1(User user1) {
		this.user1 = user1;
	}

	public User getUser2() {
		return this.user2;
	}

	public void setUser2(User user2) {
		this.user2 = user2;
	}

}